/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package padroes_3;

/**
 *
 * @author Delvoux
 */
public class ContaCorrente extends Conta{
    private float chequeEspecial;

    public ContaCorrente() {
    }
        
    public float getSaldo() {
        return this.saldo+this.chequeEspecial;
    }

    public boolean saque(float valor) {
        if((this.saldo + this.chequeEspecial) >= valor)
            this.saldo -= valor;
        else
            return false;
        return true;
    }

    public String getExtrato(){
        return "####### CONTA CORRENTE \nSaldo: "+this.saldo+"\nCheque especial: "+this.chequeEspecial+"\nSaldo Total: "+(this.saldo+this.chequeEspecial);
    }

    public boolean transferencia(Conta para, float valor) {
        if((this.saldo+this.chequeEspecial) >= valor){
            this.saldo -= valor;
            para.saldo += valor;
        } else
            return false;
        return true;

    }

    @Override
    public String toString() {
        return "ContaCorrente{" + "chequeEspecial=" + chequeEspecial + '}';
    }
}
